package com.ganeshkrishnan.globald.dao.hibernate;

import java.util.List;

import com.ganeshkrishnan.globald.abstracts.GenericDaoHibernate;
import com.ganeshkrishnan.globald.dao.AlliesDao;
import com.ganeshkrishnan.globald.model.Allies;

public class AlliesDaoHibernate extends GenericDaoHibernate<Allies, Long> implements AlliesDao {
	public AlliesDaoHibernate() {
		super(Allies.class);
	}

	/**
	 * This will returns Number of civics, amount of resource and kind of resource
	 */
	 
	public List<Allies> findAlliesByPersonID(Long PersonID) {
		return getHibernateTemplate().find("from Allies where PersonID=?", PersonID);
	}

	public Allies addAlly(Allies ally) {
		getHibernateTemplate().saveOrUpdate(ally);
		getHibernateTemplate().flush();
		return ally;
	}
}
